package org.ch02.test07;

import java.lang.reflect.Array;

/**
 * @author CSY
 * @date 2025 - 03 - 19
 */
public class MainTest02 {
    public static void main(String[] args) {
        Object arr = Array.newInstance(int.class, 3);
        /*if(arr instanceof int[]) {
            int[] intArr = (int[])arr;
            intArr[0] = 1;
        }*/
        Array.set(arr, 0, 1);
        Array.set(arr, 1, 2);
        Array.set(arr, 2, 3);
        System.out.println(Array.get(arr, 0));

    }
}
